<template>

    <el-select v-model="bankId" :placeholder="placeholder" @change="onBlurChange($event)">
        <el-option v-for="item in bankList" :key="item.id" :label="item.bankName" :value="item.id"></el-option>
    </el-select>
</template>
<script>
export default {
    props: {
        value: {
            type: String,
            default: "",
        },
        placeholder: {
            type: String,
            default: "请选择授信银行",
        },
        disabled: {
            type: Boolean,
            default: false,
        },
    },
    model: {
        prop: "value",
        event: "change",
    },
    data () {
        return {
            bankId: this.value,
            bankList: [

            ]
        };
    },

    mounted () {
        this.getBankList()
    },
    methods: {
        getBankList () {
            let url = "/bank/getBankList"
            this.$get({ url }).then((res) => {
                this.bankList = res
            });

        },
        onBlurChange (event) {
            this.$emit("change", event);
        },
        reset () {
            this.bankId = ""
        }
    },
};
</script>
